const Mock = require('mockjs');

let listData = {
  "info":{
    "flag":"",
    "indexPage":1,
    "pageCount":12,
    "rows":[
      {
        "createtime":"2019-09-23 10:56:35",
        "guid":"4",
        "ids":[
        ],
        "name":"111",
        "operatorid":"4",
        "remark":"4",
        "type":4
      },
      {
        "createtime":"2019-09-16 10:56:22",
        "guid":"2",
        "ids":[
        ],
        "name":"2",
        "operatorid":"2",
        "remark":"2",
        "type":2
      },
      {
        "createtime":"2019-09-16 10:52:48",
        "guid":"1111",
        "ids":[
        ],
        "name":"1",
        "operatorid":"1",
        "remark":"1",
        "type":1
      }
    ],
    "total":3
  }
}

let oneData = {
  "info":{
    "createtime":"2019-09-16 10:52:48",
    "guid":"1111",
    "ids":[

    ],
    "name":"1",
    "operatorid":"1",
    "remark":"1",
    "type":2
  }
};

function postOne(req, res) {
  const { type, body } = req;

  return body;
}

//格式： Mock.mock( url, post/get , 返回的数据)；
Mock.mock('/api/sellform', 'post', listData);
Mock.mock('/api/sellform/add', 'post', postOne);
Mock.mock('/api/sellform/edit', 'post', oneData);
Mock.mock('/api/sellform/del', 'post', postOne);

